Image analysis techniques

ABSTRACT

A method includes the steps of obtaining a frame from an image sensor, the frame comprising a number of pixel values, detecting a change in a first subset of the pixel values, detecting a change in the second subset of the pixel values near the first subset of the pixel values, and determining an occupancy state based on a relationship between the change in the first subset of the pixel values and the second subset of the pixel values. The occupancy state may be determined to be occupied when the change in the first subset of the pixel values is in a first direction and the change in the second subset of the pixel values is in a second direction opposite the first direction.

RELATED APPLICATIONS

This application claims the benefit of provisional patent applicationSer. No. 62/455,331, filed Feb. 6, 2017, the disclosure of which ishereby incorporated herein by reference in its entirety.

FIELD OF THE DISCLOSURE

The present disclosure relates to analyzing images to detect desiredfeatures, such as motion, occupancy, and the like.

BACKGROUND

Lighting fixtures continue to evolve, incorporating features such assensors, processing circuitry, networking circuitry, and the like.Accordingly, lighting fixtures may implement lighting programs, respondto the surrounding environment, and be controlled, for example, over alocal area network and/or the Internet.

In order to respond to the surrounding environment, lighting fixtureshave previously incorporated sensors such as passive infrared (PIR)occupancy sensors and photodiode-based ambient light sensors. Whilethese conventional sensors have generally proved suitable for measuringbasic environmental conditions, there is an increasing demand forlighting fixtures capable of measuring more complex environmentalconditions and collecting larger amounts of data at higher resolutions.In an effort to provide this additional functionality, it has beenproposed to integrate an image sensor into a lighting fixture. Whileintegrating an image sensor into a lighting fixture may increase theresolution at which the lighting fixture is capable of monitoring thesurrounding environment, it has proved challenging to derive usefulinformation (e.g., occupancy state and ambient light level) from thelarge amount of data provided by an image sensor without consumingsignificant processing resources. The limited processing power availablein devices such as lighting fixtures has necessitated the development ofcomputationally inexpensive ways to determine one or more desiredenvironmental conditions from image data provided by an image sensor.Thus far, these methods have sacrificed reliability for efficiency andhave proven ineffective. Accordingly, many approaches continue to usethe aforementioned conventional sensors along with an image sensorthereby increasing the cost and complexity of a device.

In light of the above, there is a need for improved image analysistechniques to determine desired environmental conditions from image dataprovided by an image sensor. Specifically, there is a need for imageanalysis techniques that determine one or more environmental conditionsefficiently and reliably such that they are capable of implementation indevices with limited processing power.

SUMMARY

In one embodiment, a method includes the steps of obtaining a frame froman image sensor, the frame comprising a number of pixel values,detecting a change in a first subset of the pixel values, detecting achange in the second subset of the pixel values near the first subset ofthe pixel values, and determining an occupancy state based on arelationship between the change in the first subset of the pixel valuesand the second subset of the pixel values. The occupancy state may bedetermined to be occupied when the change in the first subset of thepixel values is in a first direction and the change in the second subsetof the pixel values is in a second direction opposite the firstdirection. By using the relationship between the first subset of thepixel values and the second subset of the pixel values to determine theoccupancy state, the occupancy state may be reliably and efficientlydetermined.

In one embodiment, the occupancy state is determined to be occupied whenthe change in the first subset of the pixel values is above a firstthreshold and the change in the second subset of the pixel values isabove a second threshold.

In one embodiment, the pixel values are luma values.

In one embodiment, the change in the first subset of the pixel values isbased on a difference between the first subset of the pixel values and arunning average of the first subset of the pixel values and the changein the second subset of the pixel values is based on a differencebetween the second subset of the pixel values and a running average ofthe second subset of the pixel values.

Those skilled in the art will appreciate the scope of the presentdisclosure and realize additional aspects thereof after reading thefollowing detailed description of the preferred embodiments inassociation with the accompanying drawing figures.

BRIEF DESCRIPTION OF THE DRAWING FIGURES

The accompanying drawing figures incorporated in and forming a part ofthis specification illustrate several aspects of the disclosure, andtogether with the description serve to explain the principles of thedisclosure.

FIG. 1 illustrates a lighting fixture according to one embodiment of thepresent disclosure.

FIG. 2 is a flow chart illustrating a method for determining anenvironmental condition from image data according to one embodiment ofthe present disclosure.

FIG. 3 is a flow chart illustrating a method for determining anenvironmental condition from image data according to one embodiment ofthe present disclosure.

FIG. 4 is a flow chart illustrating a method for determining anenvironmental condition from image data according to one embodiment ofthe present disclosure.

FIGS. 5A through 5C illustrate a process for detecting occupancyaccording to one embodiment of the present disclosure.

FIG. 6 is a flow chart illustrating a method for determining anenvironmental condition from image data according to one embodiment ofthe present disclosure.

FIG. 7 is a flow chart illustrating a method for determining anenvironmental condition from image data according to one embodiment ofthe present disclosure.

FIG. 8 is a flow chart illustrating a method for determining anenvironmental condition from image data according to one embodiment ofthe present disclosure.

FIG. 9 is a flow chart illustrating a method for determining anenvironmental condition from image data according to one embodiment ofthe present disclosure.

FIG. 10 is a flow chart illustrating a method for increasing theaccuracy of occupancy determined from image data according to oneembodiment of the present disclosure.

DETAILED DESCRIPTION

The embodiments set forth below represent the necessary information toenable those skilled in the art to practice the embodiments andillustrate the best mode of practicing the embodiments. Upon reading thefollowing description in light of the accompanying drawing figures,those skilled in the art will understand the concepts of the disclosureand will recognize applications of these concepts not particularlyaddressed herein. It should be understood that these concepts andapplications fall within the scope of the disclosure and theaccompanying claims.

It will be understood that, although the terms first, second, etc. maybe used herein to describe various elements, these elements should notbe limited by these terms. These terms are only used to distinguish oneelement from another. For example, a first element could be termed asecond element, and, similarly, a second element could be termed a firstelement, without departing from the scope of the present disclosure. Asused herein, the term “and/or” includes any and all combinations of oneor more of the associated listed items.

It will be understood that when an element such as a layer, region, orsubstrate is referred to as being “on” or extending “onto” anotherelement, it can be directly on or extend directly onto the other elementor intervening elements may also be present. In contrast, when anelement is referred to as being “directly on” or extending “directlyonto” another element, there are no intervening elements present.Likewise, it will be understood that when an element such as a layer,region, or substrate is referred to as being “over” or extending “over”another element, it can be directly over or extend directly over theother element or intervening elements may also be present. In contrast,when an element is referred to as being “directly over” or extending“directly over” another element, there are no intervening elementspresent. It will also be understood that when an element is referred toas being “connected” or “coupled” to another element, it can be directlyconnected or coupled to the other element or intervening elements may bepresent. In contrast, when an element is referred to as being “directlyconnected” or “directly coupled” to another element, there are nointervening elements present.

Relative terms such as “below” or “above” or “upper” or “lower” or“horizontal” or “vertical” may be used herein to describe a relationshipof one element, layer, or region to another element, layer, or region asillustrated in the Figures. It will be understood that these terms andthose discussed above are intended to encompass different orientationsof the device in addition to the orientation depicted in the Figures.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the disclosure.As used herein, the singular forms “a,” “an,” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises,”“comprising,” “includes,” and/or “including” when used herein specifythe presence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components, and/or groups thereof.

Unless otherwise defined, all terms (including technical and scientificterms) used herein have the same meaning as commonly understood by oneof ordinary skill in the art to which this disclosure belongs. It willbe further understood that terms used herein should be interpreted ashaving a meaning that is consistent with their meaning in the context ofthis specification and the relevant art and will not be interpreted inan idealized or overly formal sense unless expressly so defined herein.

FIG. 1 is a block diagram illustrating details of a lighting fixture 10according to one embodiment of the present disclosure. The lightingfixture 10 includes driver circuitry 12 and an array of light emittingdiodes (LEDs) 14. The driver circuitry 12 includes power convertercircuitry 16, communications circuitry 18, processing circuitry 20, amemory 22, and sensor circuitry 24. The power converter circuitry 16 isconfigured to receive an alternating current (AC) or direct current (DC)input signal (V_(IN)) and perform power conversion to provide aregulated output power to the array of LEDs 14. Notably, the powerconverter circuitry 16 may be configured such that the input signal(V_(IN)) is provided in whole or in part by a battery, such that thelighting fixture 10 is portable, capable of operating in emergenciessuch as power outages, and/or capable of being used in one or moreoff-grid applications as discussed below. In one embodiment, the powerconverter circuitry 16 is configured to provide a pulse-width modulated(PWM) regulated output signal to the array of LEDs 14. While not shown,a connection between the power converter circuitry 16 and each one ofthe communications circuitry 18, the processing circuitry 20, the memory22, and the sensor circuitry 24 may provide regulated power to theseportions of the driver circuitry 12 as well. The processing circuitry 20may provide the main intelligence of the lighting fixture 10, and mayexecute instructions stored in the memory 22 in order to do so. Theprocessing circuitry 20 may thus control the amount of current, voltage,or both provided from the power converter circuitry 16 to the array ofLEDs 14. The communications circuitry 18 may enable the lighting fixture10 to communicate via wireless or wired signals to one or more otherlighting fixtures, sensor modules, controllers, border routers,switches, or any other devices. The communications circuitry 18 may becoupled to the processing circuitry 20 such that information receivedvia the communications circuitry 18 can be considered and acted upon bythe processing circuitry 20. The sensor circuitry 24 may include anynumber of different sensors 26. For example, the sensor circuitry 24 mayinclude one or more passive infrared (PIR) occupancy sensors, one ormore ambient light sensors, one or more microphones, one or morespeakers, one or more ultrasonic sensors and/or transducers, one or moreinfrared receivers, one or more imaging sensors such as a camera, amulti-spectral imaging sensor, or the like, one or more atmosphericpressure sensors, one or more temperature and/or humidity sensors, oneor more air quality sensors such as oxygen sensors, carbon dioxidesensors, volatile organic compound (VOC) sensors, smoke detectors, andthe like, one or more positioning sensors such as accelerometers, GlobalPositioning Satellite (GPS) sensors, and the like, one or more magneticfield sensors, or any other sensors. The sensor circuitry 24 may be incommunication with the processing circuitry 20 such that informationfrom the sensors 26 can be considered and acted upon by the processingcircuitry 20. In some situations, the processing circuitry 20 may useinformation from the sensors 26 to adjust the voltage and/or currentprovided from the power converter circuitry 16 to the array of LEDs 14,thereby changing one or more aspects of the light provided by thelighting fixture 10. In other situations, the processing circuitry 20may communicate information from the sensors 26 via the communicationscircuitry 18 to one or more of the devices or one or more of the borderrouters in a distributed lighting network, or to one or more of theremote devices. In still other situations, the lighting fixture 10 mayboth change one or more aspects of the light provided therefrom based oninformation from the one or more sensors 26 and communicate theinformation from the one or more sensors 26 via the communicationscircuitry 18.

The array of LEDs 14 includes multiple LED strings 28. Each LED string28 includes a number of LEDs 30 arranged in series between the powerconverter circuitry 16 and ground. Notably, the disclosure is notlimited to lighting fixtures 10 having LEDs 30 arranged in this manner.The LEDs 30 may be arranged in any series/parallel combination, may becoupled between contacts of the power converter circuitry 16, orarranged in any other suitable configuration without departing from theprinciples described herein. The LEDs 30 in each one of the LED strings28 may be fabricated from different materials and coated with differentphosphors such that the LEDs 30 are configured to provide light havingdifferent characteristics than the LEDs 30 in each other LED string 28.For example, the LEDs 30 in a first one of the LED strings 28 may bemanufactured such that the light emitted therefrom is green, and includea phosphor configured to shift this green light into blue light. SuchLEDs 30 may be referred to as blue-shifted green (BSG) LEDs. The LEDs 30in a second one of the LED strings 28 may be manufactured such that thelight emitted therefrom is blue, and include a phosphor configured toshift this blue light into yellow light. Such LEDs 30 may be referred toas blue-shifted yellow (BSY) LEDs. The LEDs 30 in a third one of the LEDstrings 28 may be manufactured to emit red light, and may be referred toas red (R) LEDs. The light output from each LED string 28 may combine toprovide light having a desired hue, saturation, brightness, etc. Anydifferent types of LEDs 30 may be provided in each one of the LEDstrings 28 to achieve any desired light output. The power convertercircuitry 16 may be capable of individually changing the voltage and/orcurrent provided through each LED string 28 such that the hue,saturation, brightness, or any other characteristic of the lightprovided from the array of LEDs 30 can be adjusted.

As discussed above, it is often desirable to include an image sensor inthe sensor circuitry 24. Further, it is desirable to use the imagesensor to determine one or more environmental conditions such asoccupancy state and ambient light level. Accordingly, FIG. 2 is a flowchart illustrating a method for determining an occupancy state based onimage data from an image sensor. As discussed herein, an occupancy stateindicates whether an area of interest is occupied or unoccupied by aperson or other object of interest (e.g., a vehicle such as a forklift).The occupancy state may thus be occupied or unoccupied.

First, an image frame is captured by the image sensor (step 100). Asdiscussed herein, an image frame is a data structure including a numberof pixel values representing the light detected by the image sensor at aparticular moment of time. The pixel values may be formatted in anynumber of ways and may include, for example, values representing anintensity of light detected for a number of color channels (e.g., red,green, and blue). Spatial data is associated with each of the pixelvalues so that they are associated with a particular part of the imageframe. Accordingly, the image frame can be thought of as a matrix ofpixel values, wherein each pixel value describes the light captured in aportion of the image frame. Capturing the image frame from the imagesensor may involve reading the image data off a serial bus coupled tothe image sensor; however, the image frame may be obtained in anysuitable manner from the image sensor. For example, a downsampledversion of the image frame may be obtained by reading values from one ormore registers associated with the image sensor such as series of autoexposure values maintained in the course of an auto exposure process forthe image sensor. As discussed above, the image frame is relatively highresolution when compared to the data obtained by conventional sensors.Accordingly, determining environmental conditions from the image framemay be relatively difficult without consuming significant processingresources.

In an effort to increase the efficiency of determining one or moreenvironmental conditions from the image frame or a number of imageframes, the pixel values in the image frame are divided into zones andreduced to form one or more zone maps (step 102). For example, the imageframe may be separated into four, five, six, seven, eight, nine, or anyother number of zones each including a subset of the pixel values. Thepixel values in these zones may then be reduced to a zone value which isan aggregate of the pixel values in the zone. In one embodiment,reducing the pixel values within a zone to a zone value is done byaveraging the pixel values. The pixel values themselves may beindividually reduced into a single value (e.g., by combining theseparate intensity information for the different color channels into asingle value such as luma or luminance) before reducing the pixel valueswithin each zone to a zone value. In another embodiment, reducing thepixel values within a zone to a zone value is done by summing the pixelvalues. The result is a significantly downscaled image frame that ismuch easier to analyze and thus determine environmental conditions from.The size of each one of the zones and thus the number of zones the imageframe is separated into may be determined based on the size of an objectof interest within the image frame associated with the detection of anenvironmental condition. For example, the zones may be sizedapproximately equal to the size a person will appear in the image frameto detect an occupancy state.

Next, the occupancy state is determined based on the one or more zonemaps (step 104). Determining the occupancy state based on the one ormore zone maps may involve analyzing the zone maps according to a set ofrules to detect when a person or other object of interest is present inthe image frame while ignoring objects in the image frame which do notindicate occupancy (e.g., shadows, nearby lights turning on or off,small animals, etc.). Details regarding determining the occupancy statefrom the one or more zone maps are discussed below. Finally, theoccupancy state may be verified (step 106). Verifying the occupancystate may involve further screening the zone maps for false positiveevents and thus making sure that the occupancy detected in the previousstep was correct. In various embodiments, the last two steps arecombined into a single step such that verifying the occupancy state issimply part of determining the occupancy state.

FIG. 3 is a flow chart illustrating details of reducing the pixel valuesfrom the image frame into one or more zone maps (step 102 in FIG. 2)according to one embodiment of the present disclosure. The processbegins with the image frame (step 200). The image frame is divided intozones (step 202) as discussed above. Notably, the size and thus numberof zones the image frame is separated into is dependent on the size anobject of interest related to the environmental condition beingdetermined appears in the image frame. The pixel values within each oneof these zones are then reduced to provide a base zone map (step 204).For example, as discussed above the pixel values in each zone may besummed or averaged such that the image frame is downscaled and describedby a number of zone values, where the number of zone values aresignificantly less than the number of pixel values. As discussed above,each one of the pixel values may be reduced into a single value or asmaller value before reducing the pixel values in each zone to a zonevalue. For example, the pixel values may each be reduced to a luma orluminance value and then summed or averaged into a zone value such thatthe zone values describe an average luma or luminance within the zone.

The image frame may be used to update a background image frame (step206) for use in the construction of one or more additional zone maps asdiscussed below. As discussed herein, the background image frame is arunning average of image frames over time. Accordingly, each one of thepixel values in the background image frame is a running average ofcorresponding pixel values in a number of image frames obtained over aperiod of time. Every time an image frame is captured, the backgroundimage frame is updated. A simple blending method may be used to updateeach pixel value in the background image frame as described by Equation(1):PV _(RA)=(PV ₁*α)+PV _(RAP)*(1−α)  (1)where PV_(RA) is an updated pixel value in the background image frame,PV₁ is a corresponding pixel value in the current image frame, α is ablending factor (e.g., between 0 and 1), and PV_(RAP) is the pixel valuein the background image frame to be updated.

A zone change map may be provided by comparing the image frame to thebackground image frame (step 208). In one embodiment, every pixel valuein the background image frame is subtracted from every correspondingpixel value in the image frame to determine how far each pixel value inthe image frame deviates from a running average thereof. These pixelvalue differentials may be reduced into zone differentials by summing oraveraging on a zone-by-zone basis to provide a number of zonedifferentials, which are the zone values for the zone change map.

A background zone change map may also be updated and maintained based onthe zone change map (step 210) as described by Equation (2):ZV _(RA)=(ZV ₁*α)+ZV _(RAP)*(1−α)  (2)where ZV_(RA) is an updated zone value in the background zone changemap, ZV₁ is a corresponding zone value in the zone change map, α is ablending factor (e.g., between 0 and 1), and ZV_(RAP) is the zone valuein the background zone change map to be updated. The background zonechange map thus describes an average amount of change in zone valuesover a period of time in each zone. The various zone maps discussedabove may be used to determine one or more environmental conditions asdiscussed below.

While specific examples are discussed above, any of the base zone map,the background image frame, the zone change map, and the background zonechange map may be constructed at any level of granularity. That is, anydegree of downscaling may occur before or during the construction of anyof the zone maps to balance efficiency and data retention withoutdeparting from the principles discussed herein.

FIG. 4 is a flow chart illustrating details of determining an occupancystate from the one or more zone maps (step 104 in FIG. 2) according toone embodiment of the present disclosure. The process begins with thezone change map discussed above with respect to FIG. 3 (step 300). Thezone values for each zone in the zone change map are aggregated andcompared to a threshold (step 302). In some embodiments, this step maybe more intensive, counting and comparing the unaggregated differencesin pixel values between the image frame and the background image frameto a threshold rather than the zone values in the zone change map. Thisstep is to check for false alarm events that may trigger a very largechange in the pixel values and thus their corresponding zone values, forexample, due to a nearby light turning on or off. When all of the zonevalues change by a significant amount or a large portion of the zonevalues change by a significant amount (as indicated by the zone valuesof the zone change map) it is often attributed to a nearby light or thelighting fixture in which the image sensor is integrated either turningon or off. It is thus desirable to ignore these events when determiningan occupancy state. Accordingly, if the aggregate zone value for all ofthe zones in the zone change map is above a threshold (e.g., if asupermajority such as ⅔ of the zone values indicate a significantchange) the processing for that image frame is skipped (step 304), anoptional delay (e.g., 30 frames) is provided (step 306), and the processproceeds to wait for the next image frame for processing, starting overthe process described in FIG. 2 (step 308).

If the aggregate zone value for all of the zones in the zone change mapare not above a threshold, the process proceeds to initialize a zonecounter i representing the current zone on which the remainder of theprocess is performed to one (step 310). The zone value for zone i in thezone change map is then obtained (step 312) and compared to a zone valuethreshold T_(ZV) (step 314). In some embodiments, the absolute value ofthe zone value ZV_(i) may be compared to the zone value thresholdT_(ZV). If the current zone value ZV_(i) is not above the zone valuethreshold T_(ZV), it is checked if the zone counter i is greater than orequal to the total number of zones in the zone change map (step 316).That is, it is checked to determine whether all of the zones have beenlooped over.

If the zone counter i is greater than or equal to the total number ofzones in the change map, the process proceeds again to step 308. If thezone counter i is not greater than or equal to the total number of zonesin the change map, the zone counter i is incremented (step 318) and theprocess begins again for the next zone in the zone change map at step312. If the current zone value ZV_(i) is greater than the zone valuethreshold T_(ZV), a detection flag is set indicating the current zonefor which detection is indicated (step 320).

Next, it is determined if a detection flag was set in one or moreprevious frames to the current image frame from which the zone changemap was created (step 322). This step is provided to guard against falsealarms due to noise detected by the image sensor or other highlytransitory phenomena (e.g., insects flying near the image sensor). Insome embodiments, detection flags must be present in multiple previousimage frames (e.g., two, three, four, five, etc.) to the current framebefore occupancy will be detected. If the detection flags were set forone or more previous frames, it is then optionally determined whetherthese detection flags were set for nearby zone(s) to the zone for whichthe current detection flag was set (step 324). In this context, nearbyzone(s) may include sequential detection flags set for the same zone. Inone embodiment, detection flags must be set for three sequential framesin the same zone or neighboring zones before occupancy is detected,where neighboring zones are zones that share at least one border withone another. Notably, these numbers are merely exemplary. In someembodiments, the number of detection flags required to detect occupancymay be different if the detection flags are in the same zone andneighboring zones. For example, detection flags for x sequential framesin the same zone or for y sequential frames in neighboring zones may berequired before occupancy is detected, where x is between 2 and 30 and yis between 4 and 50. Neighboring zones can include any number of zonesthat share a border with one another. For example, a detection flag maybe set for two neighboring zones, three neighboring zones, fourneighboring zones, etc. for the required number of frames beforeoccupancy is detected. In one embodiment, a detection flag counter ismaintained for each zone. The detection flag counter is incremented foreach frame in which a detection flag is set, and decremented for eachframe in which a detection flag is not set. When the detection flagcounter for a zone reaches a threshold (e.g., between two and twenty,and in one embodiment three), the occupancy state may be determined asoccupied.

The foregoing is illustrated in FIGS. 5A through 5C. FIG. 5A shows anexemplary series of sequential image frames 32 captured from an imagesensor, each of which are divided into a number of zones 34. Hatching ina zone indicates a detection flag being set for that zone. Theneighboring zones to the first zone in which a detection flag has beenset are illustrated with stippling. In a first one of the image frames32, a detection flag is set in a first zone. A detection flag counter isincremented in response to the setting of the detection flag. The firstzone in which a detection flag is set that is not part of a previoussequential series of detection flags for a set of neighboring zonesdefines a set of zones in which a detection flag must be set to continueincrementing the detection flag counter as discussed below. This isillustrated by the stippled zones surrounding the first zone. In asecond one of the image frames 32, a detection flag is set in aneighboring zone to the first zone, and the detection flag counter isincremented. In a third one of the image frames 32, a third detectionflag is set in a neighboring zone to the first zone, and the detectionflag counter is incremented. As discussed above, occupancy may bedetected when detection flags are set for three sequential frames in thesame zone or neighboring zones. That is, occupancy may be detected whenthe detection flag counter reaches three. In the example shown in FIG.5A, occupancy may thus be detected in the third one of the image frames32.

FIG. 5B shows another exemplary series of sequential image frames 32,each of which are divided into a number of zones 34. Again, hatching ina zone indicates a detection flag being set for that zone. Theneighboring zones to the zone in which a detection flag has been set areillustrated with stippling. In a first one of the image frames 32, adetection flag is set in a first zone. A detection flag counter isincremented in response to the setting of the detection flag. In asecond one of the image frames 32, a detection flag is set in aneighboring zone to the first zone, and the detection flag counter isincremented. In a third one of the image frames 32, no motion isdetected and thus a detection flag is not set. In response, thedetection flag counter is decremented. In a fourth one of the imageframes 32, a detection flag is set in a neighboring zone to the firstzone, and the detection flag counter is incremented. In a fifth one ofthe image frames 32, a detection flag is set in the same zone as in thefourth one of the image frames, and the detection flag counter isincremented. An occupancy event is detected at this time.

FIG. 5C shows another exemplary series of sequential image frames 32,each of which are divided into a number of zones 34. Again, hatching ina zone indicates a detection flag being set for that zone. Theneighboring zones to the zone in which a detection flag has been set areillustrated with stippling. In a first one of the image frames 32, adetection flag is set in a first zone. A detection flag counter isincremented in response to the setting of the detection flag. In asecond one of the image frames 32, a detection flag is set in aneighboring zone to the first zone, and the detection flag counter isincremented. In a third one of the image frames 32, a detection flag isset for a zone that is not neighboring the first zone. Since thedetection flag is not in a neighboring zone to the first zone, the firstzone is redefined as the one in which the detection flag occurred andthus redefines the set of zones in which a detection flag must be set tocontinue incrementing the detection flag counter. Further, this causesthe detection flag counter to reset back to one. In a fourth one of theimage frames 32, a detection flag is again set for a zone that is notneighboring the first zone that was set in the third one of the imageframes 32. This one again redefines the first zone and thus the set ofzones in which a detection flag must be set to continue incrementing thedetection flag counter. Further, this causes the detection flag counterto reset back to one. An occupancy event is not detected in the seriesof image frames 32 shown in FIG. 5C, because the detection flags are notneighboring one another in the sequential frames. This may indicate avery fast-moving object for which occupancy should not be detected. Bydetecting occupancy in this manner, false positives due to thesefast-moving objects may be avoided, thus increasing the accuracy ofoccupancy detection.

This may once again guard against noise or other transitory phenomenawherein a detection is indicated for zones occurring on opposite sidesof the frame. If the detection flags were not set for nearby zone(s) tothe zone for which the current detection flag was set, the processproceeds again to step 316. If the detection flags were set for nearbyzone(s) to the zone for which the current detection flag was set, theoccupancy state is determined as occupied (step 326). If a detectionflag was not set for one or more previous frames, the occupancy stateremains unoccupied and the process proceeds again to step 316.

The process described above is described in further detail in U.S.patent application Ser. No. 15/191,753, the contents of which are herebyincorporated by reference in their entirety. Due to the varioussafeguards provided in this process, an occupancy state may be reliablydetermined while avoiding false alarms. Further, since such a processuses the zone change map rather than the image frame itself, it may beperformed with minimal processing power. In some scenarios, however,further refinements in occupancy detection may be necessary to avoidfalse alarm detections. For example, the aforementioned process may havedifficulty filtering false alarm detections due to highly specularreflections from nearby lights on a glossy or semi-glossy flooringsurface.

Accordingly, FIG. 6 is a flow chart illustrating details of verifying(or in some embodiments independently determining) an occupancy statebased on the one or more zone maps (step 106 in FIG. 2). The processstarts with the zone change map determined above with respect to FIG. 3(step 400). Once again, a zone change counter i is initialized to one(step 402), the zone value for zone i in the zone change map is obtained(step 404) and compared to a zone value threshold T_(ZV) (step 406). Insome embodiments, the absolute value of the zone value ZV_(i) may becompared to the zone value threshold T_(ZV). This is because, asdiscussed above, the zone values in the zone change map may indicate apositive change over the running average of the zone value or a negativechange over the running average of the zone value. This portion of theprocess may be performed together with the overlapping portion of thatdescribed in FIG. 4 or performed independently. If the current zonevalue ZV_(i) is not above the zone value threshold T_(ZV), it is checkedif the zone counter i is greater than or equal to the total number ofzones in the zone change map (step 408). That is, it is checked todetermine whether all of the zones have been looped over.

If the zone counter i is greater than or equal to the total number ofzones in the zone change map, the process proceeds to wait for the nextimage frame for processing, starting over the process described in FIG.2 (step 410). If the zone counter i is not greater than or equal to thetotal number of zones in the zone change map, the zone counter i isincremented (step 412) and the process begins again for the next zone inthe zone change map at step 404. If the current zone value ZV_(i) isabove the zone value threshold T_(ZV), it is determined if a zone valueZV_(AZ) for a zone adjacent to the current zone in the zone change mapis above an adjacent zone value threshold T_(AZ) and has an oppositesign to that of the current zone value ZV_(i) (step 414). In someembodiments, the absolute value of the adjacent zone value ZV_(AZ) maybe compared to the adjacent zone value threshold T_(AZ). The adjacentzone value threshold T_(AZ) may be related to the zone valuecorresponding with the zone of the adjacent zone value ZV_(AZ) in thebackground zone change map as illustrated by the input provided to step414. For example, the adjacent zone value threshold T_(AZ) may be equalto TV*ZV_(AZC) where TV is a threshold value between 1.5 and 6 andZV_(AZC) is the zone value for the zone of the adjacent zone valueZV_(AZ) in the background change map. The adjacent zone value thresholdT_(AZ) may also be a constant value such as 800.

The zone value in the zone change map is associated with a signindicating a direction of change of the zone value in the base zone map.For example, in the case where the zone values in the zone change maprepresent luma or luminance values, the luma or luminance may increasedue to the presence of a bright object in the zone thereby giving thezone value in the zone change map a positive value, or may decrease dueto the presence of a dark object in the zone thereby giving the zonevalue in the zone change map a negative value. The sign of the zonevalues in the zone change map thus indicates a direction of change. Onceit is established that a zone value in the zone change map is above acertain value (indicating that the zone has experienced a significantchange in luma or luminance), the zones adjacent to this zone are thenchecked to see if they have experienced a change in the oppositedirection. That is, if the current zone value ZV_(i) in step 406 isabove the zone value threshold T_(ZV), the zone values ZV_(AZ) adjacentto the current zone value ZV_(i) are then checked to see if they areabove the adjacent zone value threshold T_(AZ) and have an opposite signto the current zone value ZV_(i). In some embodiments, the zone valuethreshold T_(ZV) and the adjacent zone threshold T_(AZ) may be equal. Inother embodiments, the zone value threshold T_(ZV) and the adjacent zonevalue T_(AZ) may be different values. Further, the adjacent zonethreshold T_(AZ) may be proportional or otherwise dependent on theamount by which the current zone value ZV_(i) exceeds the zone valuethreshold T_(ZV).

Step 414 may significantly reduce the rate of false alarm detections ofoccupancy while consuming minimal processing resources. As discussedabove, specular reflections from glossy or semi-glossy floors due tooverhead lighting may provide the appearance of a change in pixel valuesand thus corresponding zone values that appear about the size of anobject of interest such as a person. Accordingly, false alarm events maybe raised when the light providing the reflection changes state. Theinventors of the present disclosure discovered that such false alarmevents can be avoided by observing that true motion by an object ofinterest such as a person (which indicates that an area is occupied)manifests as changes in a first subset of pixel values in one area andcorresponding changes in a second subset of pixel values in anothernearby area. Specifically, true motion by an object of interest such asa person is indicated when a) the first subset of pixel values changesby a first predetermined amount, b) the second subset of pixel valueschanges by a second predetermined amount which may or may not be equalto the first predetermined amount, and c) the first subset of pixelvalues and the second subset of pixel values change in oppositedirections.

As an example, if a person with a white shirt moves from a first zone toa second zone in an image frame (wherein the first subset of pixelvalues is the first zone and the second subset of pixel values is thesecond zone), the second zone will experience an increase in luma orluminance by a certain amount due to reflections from the white shirtmoving into the zone, while the first zone will experience a decrease inluma or luminance by certain amount due to the fact that the white shirthas moved out of the zone and thus is no longer reflecting light there.Here, all of the criteria discussed above are satisfied and an area cantherefore be determined to be occupied. In contrast, if a nearby lightis turned on and provides a specular reflection in the first zone thatincreases the luma or luminance in that zone, there will be no otherzone that experiences a corresponding decrease in luma or luminance.Accordingly, the criteria discussed above are not satisfied and thus anarea can therefore be determined to be unoccupied.

If the zone value ZV_(AZ) for a zone adjacent to the current zone in thezone change map is above the adjacent zone value threshold T_(AZ) andhas an opposite sign to that of the current zone value ZV_(i), theoccupancy state is determined to be occupied (step 416). If the zonevalue ZV_(AZ) for a zone adjacent to the current zone in the zone changemap is not above the adjacent zone value threshold T_(AZ) or does nothave an opposite sign to that of the current zone value ZV_(i), theprocess returns to step 408.

As discussed above, the process discussed in FIG. 6 may be performedtogether with the process described in FIG. 4 such that overlappingportions thereof are not performed twice. In other embodiments, theprocess discussed in FIG. 6 may be performed by itself to detectoccupancy events. That is, changes in a first subset of pixel values maybe detected along with corresponding changes in a second subset of pixelvalues to determine occupancy. As discussed above, the correspondingchanges in the second subset of pixel values may be in an oppositedirection of those in the first subset of pixel values, and may berequired to be above a certain threshold.

FIG. 7 illustrates the principles discussed above. FIG. 7 shows anexemplary series of sequential image frames 32 captured from an imagesensor, each of which are divided into a number of zones 34. The shadingin each one of the zones 34 indicates the normalized change inbrightness for that zone (i.e., how much the brightness has changed forthat frame when compared to a background frame as discussed above). Inorder for occupancy to be detected, a change in brightness in one zonemust occur with an opposite change in brightness in a neighboring zone,where a neighboring zone is a zone adjacent to the one in which thebrightness change occurred. If such an opposite change in brightnessdoes not occur, it may indicate a false alarm event, for example, causedby reflections from objects in the environment. Such a scenario isindicated in the first frame shown in FIG. 7. However, when a change inbrightness in one zone corresponds with an opposite change in brightnessin a neighboring zone, occupancy may be detected (subject to theadditional conditions discussed above) as indicated in the second frameshown in FIG. 7.

In addition to the processes discussed above, detection of one or moreenvironmental conditions may be further refined by using a neuralnetwork along with the one or more zone maps. Accordingly, FIG. 8 showsa process of training a neural network for detecting one or moreenvironmental conditions according to one embodiment of the presentdisclosure. The process starts by initializing a training iterationcounter i to one (step 500). A number of known outputs for a situationand a number of zone maps for the situation may then be obtained (step502). As discussed herein, a situation may be an event or collection ofevents as collected by one or more image frames from an image sensor.The known outputs may indicate, for example, an occupancy stateassociated with the zone maps for the situation. In some embodiments,the known outputs may be significantly more complex so as to indicatefurther characteristics such as a number of detected individuals, thedetection of objects (e.g., vehicles such as forklifts), or the like.The zone maps include one or more of the zone maps discussed above withrespect to FIG. 3. The known outputs and number of zone maps for thesituations are then used to train a neural network (step 504).

It is then checked whether the training iteration counter i is greaterthan or equal to a desired number of training iterations (step 506).That is, it is checked whether a desired number of training iterationshave been performed to calibrate the neural network. If the trainingiteration counter i is greater than or equal to the desired number oftraining iterations, the process proceeds to stop training (step 508).If there are more training iterations desired, the situation counter iis incremented (step 510) and the process returns to step 502.

In one embodiment, the neural network is a convolutional neural network;however, any suitable type of neural network may be used withoutdeparting from the principles of the present disclosure. By training aneural network using the zone maps, which as discussed above aredownscaled versions of an image frame, the neural network may be able toreliably determine environmental conditions such as occupancy with ahigh degree of efficiency.

FIG. 9 is a flow chart illustrating a process for determining one ormore environmental conditions using data from an image sensor. First, animage frame is captured from the image sensor (step 600). The imageframe may be captured in any number of ways as discussed above. Thepixel values within the image frame are then reduced to provide one ormore zone maps (step 602). Details regarding reducing an image frameinto a number of zone maps are discussed above with respect to FIG. 3.One or more environmental conditions are then determined by processingthe one or more zone maps in a neural network (step 604) which has beenappropriately trained as discussed above. Again, by using the zone mapsinstead of image frames, the efficiency of environmental conditiondetection may be very high while still providing a high degree ofreliability.

Any of the processes discussed with respect to FIGS. 2-4 and 8-9 may beperformed by the lighting fixture 10 discussed above with respect toFIG. 1. Accordingly, the processes may be represented by instructionsstored in the memory 22 and executed by the processing circuitry 20. Theimage sensor may be one of the sensors 26 in the sensor circuitry 24. Inother embodiments, the image sensor may be remote from but in wired orwireless communication with the lighting fixture 10. In still otherembodiments, the image sensor may be located in a lighting fixture butthe processes discussed above may be performed remotely by one or moreother devices such as a sensor module, a border router, or the like.Details about these components can be found in U.S. patent applicationSer. No. 15/191,753 which is incorporated herein above. Alternatively,the processes discussed above may be provided as instructions on anon-transient computer readable medium containing program instructionsfor causing a computer to implement the processes as described.

The various ways to reliably and efficiently determine an occupancystate may be used to control a light output of a lighting fixture suchas the one described above with respect to FIG. 1. When the occupancystate changes from unoccupied to occupied, the light output of thelighting fixture may be changed. For example, the lighting fixture maybe turned on in response to such a change. Such a change may be enactedlocally within the lighting fixture when the processes discussed aboveare locally executed or by a command provided from a remote device fromthe lighting fixture when they are not. Similarly, when the occupancystate changes from occupied to unoccupied, the light output of thelighting fixture may also be changed, or may change after some period oftime (i.e., a timeout period). For example, the lighting fixture may beturned off in response to such a change. Once again, such a change maybe enacted locally within the lighting fixture when the processesdiscussed above are locally executed or by a command provided from aremote device from the lighting fixture when they are not.

In an effort to further improve the accuracy of occupancy detectionusing an image sensor as discussed above, the lighting fixture 10 mayinclude at least two image sensors in the sensor circuitry 24, or mayinclude an image sensor with a binocular lens. Using multiple imagesensors or an image sensor with a binocular lens may allow the lightingfixture 10 to determine or approximate a distance between an object seenby the image sensor and the image sensor itself. This may allow for thefiltering of motion not due to desired persons/objects for whichoccupancy is to be detected (e.g., motion from insects flying near theimage sensor) and thus increased accuracy of occupancy detection usingthe image sensor.

Methods for determining the distance of an object using binocular vision(either by virtue of multiple image sensors or a single image sensorwith a binocular lens) will be readily appreciated by those skilled inthe art. In one embodiment, pre-calibration of a per-pixel correlationbetween the multiple image sensors or the separate fields of viewprovided by an image sensor with a binocular lens is performed for oneor more target operating distances, and binocular disparity betweenobjects is used to determine a relative difference between objects andthus determine whether the motion provided therefrom should change anoccupancy state of the lighting fixture 10.

FIG. 10 is a flow chart illustrating a process for increasing theaccuracy of occupancy detection using multiple image sensors and/or asingle image sensor with a binocular lens. While the process isdiscussed with respect to separate image sensors, the same conceptsapply to a single image sensor with a binocular lens, as will beappreciated by those skilled in the art. The process starts with a firstimage frame captured from a first image sensor and a second image framecaptured by a second image sensor (step 700). A pixel difference valuebetween overlapping pixel values in the first image frame and the secondimage frame is then taken (step 702). The pixel difference values may beaggregated by zone to obtain a stereo difference map (step 704), similarto the process discussed above with respect to FIG. 3 to obtain the zonechange map. The stereo difference map is associated with a level ofstereo disparity between the views provided by the separate imagesensors (or the single image sensor with a binocular lens), and willincrease when objects near the cameras are detected and decrease to zeroat optical infinity. In an exemplary scenario where a desired plane fordetecting occupancy is ten to sixty feet below the image sensors (e.g.,a sidewalk is ten to sixty feet below an outdoor lighting fixture), theoptics for the image sensors can be configured such that the targetplane is effectively at optical infinity. The sum for each zone in theregion of overlapping pixels may be normalized in some embodiments andthen used to adjust the zone change map discussed above with respect toFIG. 4 and FIG. 6 to increase the accuracy of occupancy detection (step706).

In one embodiment, each zone in the stereo difference map corresponds toa zone in the zone change map. The zone change value for each zone inthe zone change map is adjusted using a stereo difference value for eachcorresponding zone in the stereo difference map. As discussed above, ahigher stereo difference value indicates a greater amount of stereodisparity, and thus the zone change value may be reduced by an amountproportional to the stereo difference value in order to reduce theimpact of motion that is not on the desired plane for detectingoccupancy (e.g., insects very close to the image sensor) on thedetection of occupancy. Accordingly, false positives in the detection ofoccupancy can be significantly reduced.

Those skilled in the art will recognize improvements and modificationsto the preferred embodiments of the present disclosure. All suchimprovements and modifications are considered within the scope of theconcepts disclosed herein and the claims that follow.

What is claimed is:
 1. A method for determining occupancy of an area,the method comprising: obtaining a frame from an image sensor, the framecomprising a plurality of pixel values; detecting a change in a firstsubset of the plurality of pixel values above a first threshold withrespect to a background frame, wherein the first subset of the pluralityof pixel values has a first area in the frame and the background framecomprises an average of pixel values for a plurality of frames obtainedfrom the image sensor; setting a detection flag and incrementing adetection flag counter in response to detecting the change in the firstsubset of the plurality of pixel values above the first threshold,wherein the detection flag counter indicates a number of detection flagsfrom previous image frames; determining an occupancy state of the area,wherein the occupancy state is determined to be occupied when thedetection flag counter reaches a second threshold; detecting acorresponding change in a second subset of the plurality of pixel valuesabove a third threshold with respect to the background frame, whereinthe second subset of the plurality of pixel values has a second area inthe frame that is adjacent to the first area; and verifying theoccupancy state based on a relationship between the change in the firstsubset of the plurality of pixel values and the change in the secondsubset of the plurality of pixel values, wherein the occupancy state isverified to be occupied when the change in the first subset of theplurality of pixel values is in a first direction and the change in thesecond subset of the plurality of pixel values is in a second directionopposite the first direction.
 2. The method of claim 1 wherein the firstthreshold is substantially equal to the third threshold.
 3. The methodof claim 1 wherein the plurality of pixel values are luma values.
 4. Themethod of claim 1 wherein: the change in the first subset of theplurality of pixel values is based on a difference between the firstsubset of the plurality of pixel values and a running average of thefirst subset of the plurality of pixel values from the background frame;and the change in the second subset of the plurality of pixel values isbased on a difference between the second subset of the plurality ofpixel values and a running average of the second subset of the pluralityof pixel values from the background frame.
 5. The method of claim 1further comprising: separating the plurality of pixel values into aplurality of zones; and for each one of the plurality of zones, reducingthe ones of the plurality of pixel values in the one of the plurality ofzones into a zone value, wherein: the first subset of the plurality ofpixel values corresponds with a first zone and the second subset of theplurality of pixel values corresponds with a second zone adjacent to thefirst zone; detecting the change in the first subset of the plurality ofpixel values comprises detecting a change in a first zone valueassociated with the first zone; and detecting the corresponding changein the second subset of the plurality of pixel values comprisesdetecting a change in a second zone value associated with the secondzone.
 6. The method of claim 5 wherein the zone value associated witheach one of the plurality of zones is a mean luma value based on theones of the plurality of pixel values in the one of the plurality ofzones.
 7. The method of claim 5 wherein: detecting the change in thefirst subset of the plurality of pixel values comprises determining afirst difference between the first zone value and a corresponding valueof the first zone from the background frame; and detecting thecorresponding change in the second subset of the plurality of pixelvalues comprises determining a second difference between the second zonevalue and a corresponding value of the second zone from the backgroundframe and comparing the first direction of the first difference and thesecond direction of the second difference.
 8. The method of claim 7wherein the occupancy state is verified to be occupied when the firstdirection of the first difference and the second direction of the seconddifference are opposite.
 9. The method of claim 7 wherein the occupancystate is further determined to be occupied when a detection flag is setfor a third zone nearby the first zone.
 10. The method of claim 7wherein the occupancy state is further determined to be occupied when adetection flag was set for a third zone nearby the first zone in aprevious frame.
 11. The method of claim 7 wherein the occupancy state isfurther determined to be occupied when detection flags are set for oneor more of the first zone and neighboring zones in a predeterminednumber of sequential frames, wherein the neighboring zones share atleast one border with the first zone or one another.
 12. The method ofclaim 1 wherein: detecting the change in the first subset of theplurality of pixel values comprises detecting an amount of the change inthe first subset of the plurality of pixel values; and detecting thecorresponding change in the second subset of the plurality of pixelvalues comprises detecting an amount of the change in the second subsetof the plurality of pixel values.
 13. The method of claim 12 wherein:the amount of the change in the first subset of the plurality of pixelvalues is based on a difference between the first subset of theplurality of pixel values and a running average of the first subset ofthe plurality of pixel values from the background frame; and the amountof the change in the second subset of the plurality of pixel values isbased on a difference between the second subset of the plurality ofpixel values and a running average of the second subset of the pluralityof pixel values from the background frame.
 14. The method of claim 1wherein the detection flag counter is decremented when there is nochange in the first subset of the plurality of pixel values above thefirst threshold.
 15. An apparatus comprising: processing circuitry; anda memory coupled to the processing circuitry, the memory storinginstructions which when executed by the processing circuitry cause theapparatus to: obtain a frame from an image sensor, the frame comprisinga plurality of pixel values; detect a change in a first subset of theplurality of pixel values above a first threshold with respect to abackground frame, wherein the first subset of the plurality of pixelvalues has a first area in the frame and the background frame comprisesan average of pixel values for a plurality of frames obtained from theimage sensor; set a detection flag and increment a detection flagcounter in response to detecting the change in the first subset of theplurality of pixel values above the first threshold, wherein thedetection flag counter indicates a number of detection flags fromprevious image frames; determine an occupancy state of the area, whereinthe occupancy state is determined to be occupied when the detection flagcounter reaches a second threshold; detect a corresponding change in asecond subset of the plurality of pixel values above a third thresholdwith respect to the background frame, wherein the second subset of theplurality of pixel values has a second area in the frame that isadjacent to the first area; and verify the occupancy state based on arelationship between the change in the first subset of the plurality ofpixel values and the change in the second subset of the plurality ofpixel values, wherein the occupancy state is verified to be occupiedwhen the change in the first subset of the plurality of pixel values isin a first direction and the change in the second subset of theplurality of pixel values is in a second direction opposite the firstdirection.
 16. The apparatus of claim 15 further comprising: a solidstate light source; and power converter circuitry coupled to the solidstate light source and the processing circuitry, wherein the memorystores further instructions which when executed by the processingcircuitry cause the apparatus to control a light output of the solidstate light source via the power converter circuitry based on theoccupancy state.
 17. The apparatus of claim 16 wherein: the change inthe first subset of the plurality of pixel values is based on adifference between the first subset of the plurality of pixel values anda running average of the first subset of the plurality of pixel valuesfrom the background frame; and the change in the second subset of theplurality of pixels is based on a difference between the second subsetof the plurality of pixel values and a running average of the secondsubset of the plurality of pixel values from the background frame.
 18. Anon-transient computer readable medium containing program instructionsfor causing a computer to perform a method of: obtaining a frame from animage sensor, the frame comprising a plurality of pixel values;detecting a change in a first subset of the plurality of pixel valuesabove a first threshold with respect to a background frame, wherein thefirst subset of the plurality of pixel values has a first area in theframe and the background frame comprises an average of pixel values fora plurality of frames obtained from the image sensor; setting adetection flag and incrementing a detection flag counter in response todetecting the change in the first subset of the plurality of pixelvalues above the first threshold, wherein the detection flag counterindicates a number of detection flags from previous image frames;determining an occupancy state of the area, wherein the occupancy stateis determined to be occupied when the detection flag counter reaches asecond threshold; detecting a corresponding change in a second subset ofthe plurality of pixel values above a third threshold with respect tothe background frame, wherein the second subset of the plurality ofpixel values has a second area in the frame that is adjacent to thefirst area; and verifying the occupancy state based on a relationshipbetween the change in the first subset of the plurality of pixel valuesand the change in the second subset of the plurality of pixel values,wherein the occupancy state is verified to be occupied when the changein the first subset of the plurality of pixel values is in a firstdirection and the change in the second subset of the plurality of pixelvalues is in a second direction opposite the first direction.
 19. Thenon-transient computer readable medium of claim 18 wherein the pixelvalues are luma values.
 20. The non-transient computer readable mediumof claim 18 wherein: the change in the first subset of the plurality ofpixel values is based on a difference between the first subset of theplurality of pixel values and a running average of the first subset ofthe plurality of pixel values from the background frame; and the changein the second subset of the pixel values is based on a differencebetween the second subset of the plurality of pixel values and a runningaverage of the second subset of the plurality of pixel values from thebackground frame.